package day05

/**
  * 科里化方法(可以有两个括号的)
  */
class Klh {



}
object Klh{
  def main(args: Array[String]): Unit = {
    /*val klh: Int = klh1(2)(3)
    println(klh)

    val klh3: (Int) => Int = klh1(3)(_)
    val klh4: Int = klh3(2)
    println(klh4)

    val klh5: Int = klh2(4)(4)
    println(klh5)*/

    val parmater1: Int = parmater(1)
    println(parmater1)
  }

  /**
    * 科里化方法
    */
  def klh1(x:Int)(y:Int): Int ={
    x+y
  }

  //科里化方法2
  def klh2(x:Int) = (y:Int) => x+y

  def klh3(x:Int)(y:Int)(z:Int) = x+y+z

  def parmater(x:Int,y:Int=100): Int ={
    x+y
  }
}
